package LxTest.text10;

import java.awt.image.ImageFilter;
import java.util.ArrayList;

public class StudentTest {

    public static void main(String[] args) {

        //1.容器
        //2.学生对象


        ArrayList<Student> studentList = new ArrayList<>();

        //创建学生

        Student s1 = new Student(1,"张三");

        Student s2 = new Student(2,"李四");

        Student s3 = new Student(3,"王五");



        studentList.add(s1);
        studentList.add(s2);
        studentList.add(s3);




        for (int i = 0; i < studentList.size(); i++) {

            System.out.println(studentList.get(i));
        }

        for (Student student : studentList){
            if (student.getName().equals("张三")){
                student.setName("张三丰");
                break;
            }
        }
        System.out.println("修改后的信息为 ");
        for (Student student : studentList){
            System.out.println(student);
        }

    }
}